#ifndef FRMDEVICECONFIG_H
#define FRMDEVICECONFIG_H

#include <QWidget>
#include "frmmain.h"
#include "config.h"

namespace Ui {
class frmdeviceconfig;
}

class frmdeviceconfig : public QWidget
{
    Q_OBJECT

public:
    explicit frmdeviceconfig(QWidget *parent = nullptr);
    ~frmdeviceconfig();

private slots:
    void on_enterCommandModeButton_clicked();
    void on_exitCommandModeButton_clicked();
    void on_sendConfigButton_clicked();
    void on_cancelButton_clicked();
    void onSerialConnectionChanged(bool connected);
    void onTcpConnectionChanged(bool connected);

private:
    Ui::frmdeviceconfig *ui;
    frmmain *mainWindow;
    bool isCommandMode;

    void sendCommandModeCommand(bool enter);
    void updateMainResponse(const QString &msg);
    void enableConfigControls(bool enable);
    void resetConfigFields();
};

#endif // FRMDEVICECONFIG_H